import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//按需导入element-plus
import { globalRegister } from '@/global'
import './assets/css/index.less'
import 'tailwindcss/tailwind.css'
import { setupStore } from './store'
import 'virtual:windi.css'
import jjRequest from '@/service1'
import { AxiosResponse } from 'axios'
import { IDataType } from '@/service/types'

const app = createApp(App)
app.use(globalRegister)
app.use(store)
setupStore()
app.use(router)

app.mount('#app')

//测试axios的封装
// jjRequest
//   .request<IDataType>({
//     url: '/xxx',
//     interceptors: {
//       requestInterceptor: (config) => {
//         console.log('单个请求拦截,封装顺序3')
//         return config
//       },
//       responseInterceptor: (res) => {
//         console.log('单个响应拦截,封装顺序3')
//         return res.data
//       }
//     }
//   })
//   .then((res) => {
//     console.log(res)
//   })
//   .catch((err) => {
//     console.log('=====', err)
//   })
